#!/usr/bin/env python
# Last Change: 2010-03-19 00:36:49

from util import *
import sys, os

@abstract
class plugin:

  @abstract
  def author(self):
    pass
  
  @abstract
  def name(self):
    pass

  @abstract
  def email(self):
    pass

  @abstract
  def details(self):
    pass

  @abstract
  def handlers(self):
    pass

  @abstract
  def roots(self):
    pass

  @abstract
  def getpref(self):
    pass

  @abstract
  def setpref(self, pref):
    pass

def load():
  root = 'plugins'
  dirs = os.listdir(root)
  dirs = filter(lambda x: not x.startswith('.'), dirs)
  dirs = map(lambda x: os.path.join(root, x), dirs)
  dirs = filter(lambda x: os.path.isdir(x), dirs)
  modules = map(lambda x: x.replace(os.sep, '.'), dirs)

  for mod in modules:
    __import__(mod)
